package duolimoshi;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class MultiTest {

    private MultiTest() { //防止外部去new对象

    }

    private static List<MultiTest> list = new ArrayList<>();

    static {
        MultiTest multiTest = new MultiTest();
        for (int i = 0; i < 10; i++) {
            list.add(multiTest);
        }
    }

    public static MultiTest getInstance() {
        Random random = new Random();
        int i = random.nextInt(10);
        return list.get(i);
    }
}
